const TokenKey = 'Admin-Token';
const SydKey = 'Syd-Token';

const tokenStorage = useStorage<null | string>(TokenKey, null);

const SydStorage = useStorage(SydKey, {},
  undefined,
  {
    serializer: {
      read: (v: any) => v ? JSON.parse(v) : null,
      write: (v: any) => JSON.stringify(v),
    },
  });


export const getToken = () => tokenStorage.value;

export const setToken = (access_token: string) => (tokenStorage.value = access_token);

export const removeToken = () => (tokenStorage.value = null);

export const getSydToken = () => SydStorage.value;

export const setSydToken = (syd_token) => (SydStorage.value = syd_token);

export const removeSydToken = () => (SydStorage.value = null);

